#include<stdio.h>

int main()
{
	int n,m,i,j,a[100],maximum,sum;
	double average;
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		sum=0;
		scanf("%d",&m);
		for (j=0;j<m;j++)
		{
			scanf("%d",&a[j]);
			sum+=a[j];
		}
		maximum=a[0];
		for (j=1;j<m;j++)
			if (a[j]>maximum)
				maximum=a[j];
		average=(double)sum/m;
		printf("%d %.2lf\n",maximum,average);
	}
	return 0;
}
